package com.rskg.g_rskg.controller;

import com.rskg.g_rskg.Mapper.EbookMapper;
import com.rskg.g_rskg.domin.Ebook;
import com.rskg.g_rskg.resp.CommonResp;
import com.rskg.g_rskg.resp.EbookResp;
import com.rskg.g_rskg.service.EbookService;
import com.rskg.g_rskg.teq.EbookReq;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/ebook")
public class EbookController {
    @Resource
    private EbookService ebookService;

    @Value("xsy")
   private String testName;

    @GetMapping("/list")
    public CommonResp  list(EbookReq req){
        CommonResp<List<EbookResp>> rest = new CommonResp<>();
        List<EbookResp> list = ebookService.list(req);
        rest.setContent(list);
        return rest;
    }
}
